package docking;

import java.util.ArrayList;
import javax.swing.JDialog;
import javax.swing.JTable;


public class GUI extends javax.swing.JFrame {
    private DataHandler dataHandler;
   
    public GUI(DataHandler dataHandler) {
        this.dataHandler = dataHandler;
        initComponents();
        populateBBList();
        populateShipsList();
        populateServiceList();
    }
    
    
    /**
     * 
     * Metodir til Menu Barrina
     */
    
    /**
     *  metoda sum ger eitt nytt jpanel, sum kann constructa eina booking/Reservation
     */
    private void newBooking()
    {
        JDialog jd = new JDialog(this, "New Booking", true);
        jd.setContentPane(new NewReservation2(dataHandler,jd));
        jd.pack();
        jd.setVisible(true);
        populateBBList();
    }
    
     /**
     *  metoda sum ger eitt nytt jpanel, sum kann constructa eitt ship/boat
     */
    private void newShip()
    {
        JDialog jd = new JDialog(this, "New Ship", true);
        jd.setContentPane(new NewBoat(dataHandler,jd));
        jd.pack();
        jd.setVisible(true);
        populateShipsList();
    }
    
     /**
     *  metoda sum ger eitt nytt jpanel, sum kann constructa eina service
     */
    private void newService()
    {
        JDialog jd = new JDialog(this, "New Service", true);
        jd.setContentPane(new NewService(dataHandler,jd));
        jd.pack();
        jd.setVisible(true);
        populateServiceList();
        
    }
    //
    //      HETTA ERU METODIR TIL TAB 1
    //
    
    /**
     *  Refreshar "Calender", ella tað er so meiningin,
     *  út frá dato sum tú hevur skriva, kanst tú fáa
     */
    private void bookingsOnDate()
    {
        int year = yearBox.getSelectedIndex() + 2012;
        int month = monthBox.getSelectedIndex() + 1;
        int day = dayBox.getSelectedIndex() + 1;
        
        ArrayList<Reservation> temp = dataHandler.getReservations(year, month, day);
        
        Reservation[] tempArray = new Reservation[temp.size()];
        int index = temp.size();
        
        for(int i = 0; i < tempArray.length; i++)
        {
             tempArray[i] = temp.get(i);
        }
        h1List.setListData(tempArray);
    }
    
   
    
    
    //
    //      HETTA ERU METODIR TIL TAB 2
    //
    
     /**
     *  í booking tab, hetta refreshar listan og addar reservatiónirnar í listan
     */
    private void populateBBList()
    {
        ArrayList<Reservation> temp = dataHandler.getReservations();
        
        
        String[] tempArray = new String[temp.size()];
        int index = temp.size();
        
        for(int i = 0; i < tempArray.length; i++)
        {
                tempArray[i] = temp.get(i).toString();
        }
        bBList.setListData(tempArray);
        
    }
    
     /**
     *  tá man velur eina reservatión, so prentar programmi specifikatiónirnar út á GUI
     */
    private void selectedBB()
    {
        int index = bBList.getSelectedIndex();
        
        Reservation temp = dataHandler.getReservations().get(index);
        
        lblReservationNumber.setText(temp.toString());
        lvlShipsName.setText(temp.getBoat().getName());
        lblContack.setText(temp.getBoat().getInfo());
        lblFrom.setText(temp.reservationDateStringFrom());
        lblTo.setText(temp.reservationDateStringTo());
        lblPrice.setText(temp.getPrice()+"");
        populateReservationServiceList(temp);
    }
    
     /**
     *  populatar allar services sum eri í system, og koyrir tað í jList
     */
    private void populateServiceList()
    {
        ArrayList<Service> temp = dataHandler.getServiceList();
        
        
        String[] tempArray = new String[temp.size()];
        int index = temp.size();
        
        for(int i = 0; i < tempArray.length; i++)
        {
            
                tempArray[i] = temp.get(i).getName();
            
        }
        
        serviceList.setListData(tempArray);
    }
    
     /**
      * populatar services sum eru viðheftar til reservatiónina
      * 
      * @param reservation 
      */
    private void populateReservationServiceList(Reservation r)
    {
        ArrayList<Service> temp = r.getServiceList();
        
        
        String[] tempArray = new String[temp.size()];
        int index = temp.size();
        
        for(int i = 0; i < tempArray.length; i++)
        {
                tempArray[i] = temp.get(i).getName();
        }
        
        orderedServiceList.setListData(tempArray);
    }
    
     /**
     * addar selected service frá serviceList, til reservatiónina
     */
    private void addService()
    {
        int index = serviceList.getSelectedIndex();
        if(index == -1)
            return;
        
        Service temp = dataHandler.getServiceList().get(index);
        
        int indexB = bBList.getSelectedIndex();
        if(indexB == -1)
            return;
            
        Reservation temp2 = dataHandler.getReservations().get(indexB);
        
        if(temp2.getServiceList().contains(temp))
            return;
        
        temp2.addService(temp);
        populateReservationServiceList(temp2);
        
    }
    
    /**
     * fjernir selected service frá reservatiónuni
     */
    private void removeService()
    {
        int index = orderedServiceList.getSelectedIndex();
        if(index == -1)
            return;
        
        int index2 = bBList.getSelectedIndex();
        if(index2 == -1)
            return;
        
        Reservation r = dataHandler.getReservations().get(index2);
        r.getServiceList().remove(index);
        populateReservationServiceList(r);
    }
    
     /**
      * printar description hjá selected service
      */
    private void printService()
    {
        int index = serviceList.getSelectedIndex();
        
        String txt = dataHandler.getServiceList().get(index).getDescription();
        
        serviceTxTArea.setText(txt);
    }
    
    
    //
    //      HETTA ERU METODIR TIL TAB 3
    //
    
    /**
     * addar ships/boats til listan við øllum ships
     */
    private void populateShipsList()
    {
        ArrayList<Boat> temp = dataHandler.getBoats();
        
        String[] tempArray = new String[temp.size()];
        int index = temp.size();
        
        for(int i = 0; i < tempArray.length; i++)
        {
            
                tempArray[i] = temp.get(i).getName();
            
        }
        shipsList.setListData(tempArray);
    }
    
    /**
     * tá ein velur eitt ship, so printar metodar details út á GUI
     */
    private void selectedShip()
    {
        int index = shipsList.getSelectedIndex();
        Boat temp = dataHandler.getBoats().get(index);
        
        shipNL.setText(temp.getName());
        shipCL.setText(temp.getInfo());
        shipLL.setText(temp.getLength()+"");
        shipDL.setText(temp.getDepth()+"");
        
        populataShipsBooking(temp);
    }
    
    /**
     * populatar allar reservatiónirnar sum boat/ship hevur
     * 
     * @param boat 
     */
    private void populataShipsBooking(Boat b)
    {
        if(!b.getReservations().isEmpty())
        {
            String[] tempArray = new String[b.getReservations().size()];
            int index = b.getReservations().size();
            
            for(int i = 0; i < tempArray.length; i++)
            {
            
                    tempArray[i] = b.getReservations().get(i).toString();
                    
            }
            shipsBookingList.setListData(tempArray);
            //System.out.println(tempArray.length);
    
        } else {
            shipsBookingList.setListData(new String[0]);
            
        }
    }
    
    /**
     * prentar details hjá valdu reservatiónina hjá specifika skipinum
     */
    private void valueChangeSBList()
    {
        int indexA = shipsList.getSelectedIndex();
        int indexB = shipsBookingList.getSelectedIndex();
        if(indexB == -1)
            return;
        Reservation temp = dataHandler.getBoats().get(indexA).getReservations().get(indexB);
        sDFLabel.setText(temp.reservationDateStringFrom());
        sDTLabel.setText(temp.reservationDateStringTo());
        sPLabel.setText(dataHandler.getPier(temp).getName());
        sLBLBlocks.setText(temp.getNumberrOfBlocks()+"");
        sLBLPrice.setText(temp.getPrice()+" Kr");
    }
    
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        yearBox = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        monthBox = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        dayBox = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        h1Table = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        h1List = new javax.swing.JList();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        refButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        bBList = new javax.swing.JList();
        jLabel7 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        lblReservationNumber = new javax.swing.JLabel();
        lblContack = new javax.swing.JLabel();
        lvlShipsName = new javax.swing.JLabel();
        lblFrom = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        lblTo = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        serviceList = new javax.swing.JList();
        jLabel17 = new javax.swing.JLabel();
        addServiceButton = new javax.swing.JButton();
        removeServiceButton = new javax.swing.JButton();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        orderedServiceList = new javax.swing.JList();
        jLabel19 = new javax.swing.JLabel();
        serviceTxTArea = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        lblPrice = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        shipsList = new javax.swing.JList();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        shipNL = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        shipsBookingList = new javax.swing.JList();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        sDFLabel = new javax.swing.JLabel();
        sDTLabel = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        shipCL = new javax.swing.JLabel();
        shipLL = new javax.swing.JLabel();
        shipDL = new javax.swing.JLabel();
        Pier = new javax.swing.JLabel();
        sPLabel = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        sLBLBlocks = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        sLBLPrice = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        newBookingMenuItem = new javax.swing.JMenuItem();
        newShipMenuItem = new javax.swing.JMenuItem();
        newServiceMenuItem = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel4.setText("Year");

        yearBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", " " }));

        jLabel5.setText("month");

        monthBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        jLabel6.setText("Day");

        dayBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));

        jButton1.setText("Make Reservation");

        h1Table.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null}
            },
            new String [] {
                "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(h1Table);

        jLabel1.setText("Ships sum eru inni hendan dagin");

        jScrollPane9.setViewportView(h1List);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(0, 268, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane9)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 356, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane2.addTab("H1", jPanel4);

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null}
            },
            new String [] {
                "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                true, false, true, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable3);

        jLabel2.setText("jLabel2");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(66, 66, 66)
                        .addComponent(jLabel2)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 356, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane2.addTab("H2", jPanel5);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null}
            },
            new String [] {
                "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "B11", "B12", "B13"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jLabel3.setText("jLabel3");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane2.addTab("H3", jPanel6);

        jButton2.setText("Refresh Calenders");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        refButton.setText("Refresh List");
        refButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                refButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(yearBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(monthBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(dayBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                    .addComponent(refButton))
                .addGap(28, 28, 28)
                .addComponent(jTabbedPane2)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane2)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(yearBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(monthBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(21, 21, 21)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(dayBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(refButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Calender", jPanel1);

        bBList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                bBListMousePressed(evt);
            }
        });
        bBList.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                bBListKeyPressed(evt);
            }
        });
        jScrollPane4.setViewportView(bBList);

        jLabel7.setText("Booking Nummar");

        jLabel12.setText("Booking nummar");

        jLabel13.setText("Navn");

        jLabel14.setText("Contact");

        jLabel15.setText("From");

        jLabel11.setText("To");

        serviceList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                serviceListMousePressed(evt);
            }
        });
        jScrollPane7.setViewportView(serviceList);

        jLabel17.setText("Services");

        addServiceButton.setText("add");
        addServiceButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addServiceButtonActionPerformed(evt);
            }
        });

        removeServiceButton.setText("Remove");
        removeServiceButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeServiceButtonActionPerformed(evt);
            }
        });

        jLabel18.setText("Ordered Services");

        jScrollPane8.setViewportView(orderedServiceList);

        jLabel19.setText("Service Description");

        jLabel23.setText("Price");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addComponent(jLabel17))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(removeServiceButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(addServiceButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                    .addComponent(jLabel14)
                                    .addComponent(jLabel23))))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18)
                            .addComponent(lblReservationNumber)
                            .addComponent(lblContack)
                            .addComponent(lblPrice))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(serviceTxTArea, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel19)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addGap(18, 18, 18)
                                .addComponent(lvlShipsName))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addGap(30, 30, 30)
                                .addComponent(lblTo))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel15)
                                .addGap(18, 18, 18)
                                .addComponent(lblFrom))))
                    .addComponent(jLabel7))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13)
                            .addComponent(lvlShipsName)
                            .addComponent(lblReservationNumber))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(15, 15, 15)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel14)
                                    .addComponent(lblContack)
                                    .addComponent(jLabel15)
                                    .addComponent(lblFrom))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel11)
                                    .addComponent(lblTo)
                                    .addComponent(lblPrice)
                                    .addComponent(jLabel23))
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(43, 43, 43)
                                        .addComponent(jLabel17)
                                        .addGap(15, 15, 15)
                                        .addComponent(jScrollPane7))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(47, 47, 47)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel18)
                                            .addComponent(jLabel19))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(serviceTxTArea)
                                            .addComponent(jScrollPane8)))))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(addServiceButton)
                                .addGap(18, 18, 18)
                                .addComponent(removeServiceButton)
                                .addGap(168, 168, 168))))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Bookings", jPanel2);

        jLabel8.setText("Ships");

        shipsList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                shipsListMousePressed(evt);
            }
        });
        shipsList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                shipsListValueChanged(evt);
            }
        });
        jScrollPane5.setViewportView(shipsList);

        jLabel9.setText("Name");

        jLabel10.setText("Contact");

        jLabel20.setText("Bookings");

        shipsBookingList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                shipsBookingListMouseClicked(evt);
            }
        });
        jScrollPane6.setViewportView(shipsBookingList);

        jLabel21.setText("Date from");

        jLabel22.setText("Date to");

        jLabel25.setText("Pier Nr from");

        jLabel26.setText("pier nr to");

        jLabel27.setText("Blocks");

        jLabel31.setText("Length");

        jLabel32.setText("Depth");

        Pier.setText("Pier");

        jLabel16.setText("BRT");

        jLabel24.setText("[]");

        jLabel28.setText("Price");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel20)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel10)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(shipCL))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel9)
                                        .addGap(18, 18, 18)
                                        .addComponent(shipNL)))
                                .addGap(78, 78, 78)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel32)
                                        .addGap(18, 18, 18)
                                        .addComponent(shipDL))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel31)
                                        .addGap(18, 18, 18)
                                        .addComponent(shipLL))))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel16)
                                .addGap(64, 64, 64)
                                .addComponent(jLabel24))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(44, 44, 44)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                            .addComponent(jLabel21)
                                            .addGap(45, 45, 45)
                                            .addComponent(sDFLabel))
                                        .addComponent(jLabel25)
                                        .addComponent(jLabel26)
                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(Pier)
                                                .addComponent(jLabel22))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(sDTLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(sPLabel, javax.swing.GroupLayout.Alignment.TRAILING))))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel27)
                                        .addGap(36, 36, 36)
                                        .addComponent(sLBLBlocks))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel28)
                                        .addGap(97, 97, 97)
                                        .addComponent(sLBLPrice)))))
                        .addGap(0, 272, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane5))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jLabel31)
                            .addComponent(shipNL)
                            .addComponent(shipLL))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(jLabel32)
                            .addComponent(shipCL)
                            .addComponent(shipDL))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel16)
                                .addGap(18, 18, 18))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel21)
                                    .addComponent(sDFLabel))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(sDTLabel)
                                    .addComponent(jLabel22))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(Pier)
                                    .addComponent(sPLabel))
                                .addGap(18, 18, 18)
                                .addComponent(jLabel25)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel26)
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel27)
                                    .addComponent(sLBLBlocks))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel28)
                                    .addComponent(sLBLPrice))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Ships", jPanel3);

        jMenu1.setText("New");

        newBookingMenuItem.setText("New Booking");
        newBookingMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newBookingMenuItemActionPerformed(evt);
            }
        });
        jMenu1.add(newBookingMenuItem);

        newShipMenuItem.setText("New Ship");
        newShipMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newShipMenuItemActionPerformed(evt);
            }
        });
        jMenu1.add(newShipMenuItem);

        newServiceMenuItem.setText("New Service");
        newServiceMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newServiceMenuItemActionPerformed(evt);
            }
        });
        jMenu1.add(newServiceMenuItem);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");

        jMenuItem1.setText("Under Construction");
        jMenu2.add(jMenuItem1);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
       
    }//GEN-LAST:event_jButton2ActionPerformed

    private void shipsListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_shipsListValueChanged
   
    }//GEN-LAST:event_shipsListValueChanged

    private void shipsListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_shipsListMousePressed
        selectedShip();
    }//GEN-LAST:event_shipsListMousePressed

    private void shipsBookingListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_shipsBookingListMouseClicked
        valueChangeSBList();
    }//GEN-LAST:event_shipsBookingListMouseClicked

    private void bBListKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_bBListKeyPressed
        selectedBB();
    }//GEN-LAST:event_bBListKeyPressed

    private void bBListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bBListMousePressed
        selectedBB();
    }//GEN-LAST:event_bBListMousePressed

    private void addServiceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addServiceButtonActionPerformed
        addService();
    }//GEN-LAST:event_addServiceButtonActionPerformed

    private void removeServiceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeServiceButtonActionPerformed
        removeService();
    }//GEN-LAST:event_removeServiceButtonActionPerformed

    private void serviceListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_serviceListMousePressed
        printService();
    }//GEN-LAST:event_serviceListMousePressed

    private void newBookingMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newBookingMenuItemActionPerformed
        newBooking();
    }//GEN-LAST:event_newBookingMenuItemActionPerformed

    private void newShipMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newShipMenuItemActionPerformed
        newShip();
    }//GEN-LAST:event_newShipMenuItemActionPerformed

    private void newServiceMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newServiceMenuItemActionPerformed
        newService();
    }//GEN-LAST:event_newServiceMenuItemActionPerformed

    private void refButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refButtonActionPerformed
        bookingsOnDate();
    }//GEN-LAST:event_refButtonActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        dataHandler.saveSerialization();
    }//GEN-LAST:event_formWindowClosing

   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Pier;
    private javax.swing.JButton addServiceButton;
    private javax.swing.JList bBList;
    private javax.swing.JComboBox dayBox;
    private javax.swing.JList h1List;
    private javax.swing.JTable h1Table;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable3;
    private javax.swing.JLabel lblContack;
    private javax.swing.JLabel lblFrom;
    private javax.swing.JLabel lblPrice;
    private javax.swing.JLabel lblReservationNumber;
    private javax.swing.JLabel lblTo;
    private javax.swing.JLabel lvlShipsName;
    private javax.swing.JComboBox monthBox;
    private javax.swing.JMenuItem newBookingMenuItem;
    private javax.swing.JMenuItem newServiceMenuItem;
    private javax.swing.JMenuItem newShipMenuItem;
    private javax.swing.JList orderedServiceList;
    private javax.swing.JButton refButton;
    private javax.swing.JButton removeServiceButton;
    private javax.swing.JLabel sDFLabel;
    private javax.swing.JLabel sDTLabel;
    private javax.swing.JLabel sLBLBlocks;
    private javax.swing.JLabel sLBLPrice;
    private javax.swing.JLabel sPLabel;
    private javax.swing.JList serviceList;
    private javax.swing.JTextField serviceTxTArea;
    private javax.swing.JLabel shipCL;
    private javax.swing.JLabel shipDL;
    private javax.swing.JLabel shipLL;
    private javax.swing.JLabel shipNL;
    private javax.swing.JList shipsBookingList;
    private javax.swing.JList shipsList;
    private javax.swing.JComboBox yearBox;
    // End of variables declaration//GEN-END:variables

}
